<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统配置','设备链路监控']" icon="fa fa-cog" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>设备链路监控</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">								
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1"  autocomplete="off" placeholder="选择开始时间"/>
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2"  autocomplete="off" placeholder="选择结束时间"/>
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
								</div>
								
								<div class="top_module">
									<span class="module_text">链接状态</span>
									<select name="" id="" class="module_inp" [(ngModel)]="linkState">
										<option value="">全部</option>
										<option value="1">在线</option>
										<option value="-1">离线</option>
									</select>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="设备ID...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<!--<th style="width: 55px;"><input type="checkbox" (change)="selectFn()" /></th>-->
										<th>设备ID</th>
										<th>链接状态</th>
										<th>在线时长</th>
										<th>数据包</th>
										<th>客户端地址</th>
										<th>服务器地址</th>
										<th>上线时间</th>
										<th>最后更新时间</th>
										<th>离线时间</th>
										<th>channelId</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i" >
										<!--<td><input type="checkbox" (change)="onCheckboxChangeFn(row.id)" /></td>-->
										<td>{{row.deviceId}}</td>
										<td>
											<span  *ngIf="row.status=='1'" class="green">在线</span>
					           				<span  *ngIf="row.status=='-1'" >离线</span>
										</td>
										<td>{{row.onlineTime}}</td>
										<td>{{row.inPacket}}</td>
										<td>{{row.clientAddress}}</td>
										<td>{{row.serverAddress}}</td>
										<td>{{row.onDate}}</td>
										<td>{{row.lastDate}}</td>
										<td>
											<span  *ngIf="row.status=='1'" ></span>
											<span  *ngIf="row.status=='-1'" >{{row.offDate}}</span>
										</td>
										<td>{{row.channelId}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>
